﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Soft
{

    /// <summary>
    /// 服务控制器
    /// </summary>
    public interface IServerControl
    {
      
        /// <summary>
        /// 启动
        /// </summary>
        /// <returns></returns>
        Result Start();

       
        /// <summary>
        /// 停止
        /// </summary>
        void Stop();

       
        /// <summary>
        /// 是否终结
        /// </summary>
        bool Terminated { get; set; }

       
        /// <summary>
        /// 服务状态
        /// </summary>
        ServerState State { get; }

       
        /// <summary>
        /// 服务的名称
        /// </summary>
        string ServiceName { get; }

     
        /// <summary>
        /// 处理错误的事件
        /// </summary>
        event ErrorEventHandle Error;
    }
}
